<#import "../tpl/pageTep.ftl" as page>
<div class="expand"></div>
<div class="pic-box">
  <img src="" alt="" class="pic" >
</div>
<@page.pageBase currentMenu="股东管理">
<style>
    hr {
        color: #5fb878;
        border: 1px solid;
    }
</style>
<div class="panel">
    <div class="returnBtn panel-header">
        <a  onclick="window.history.go(-1)">返回上一级</a>
    </div>
</div>
<form class="form-horizontal"  action="${basepath}/rest/manage/account/selectSubPage">
    <div class="row">
        <div class="control-group span16">
            <label class="control-label">用户昵称：</label>

            <div class="controls">
                <input type="text" class="input-normal control-text" name="name" id="name" disabled="disabled">
            </div>
        </div>
    </div>
    <div class="row">
        <div class="control-group span16">
            <label class="control-label">用户等级：</label>

            <div class="controls">
                <input type="text" class="input-normal control-text" name="rank" id="rank" disabled="disabled">
            </div>
        </div>
    </div>
    <div class="row">
        <div class="control-group span16">
            <label class="control-label">下级：</label>
        </div>
    </div>
</form>
<hr/>
<div id="grid"></div>
<!--suppress ALL -->
<script>
    var postData = GetRequest();
    $("#name").val(postData.nickname);
    switch (postData.rid) {
        case '2':
            $("#rank").val('股东');break;
        case '3':
            $("#rank").val('会员');break;
        case '4':
            $("#rank").val('普通用户');break;
    }
    var Grid = BUI.Grid,
            Store = BUI.Data.Store,
            columns = [
                {title : '序号',dataIndex :'id', elCls: 'center', width:'10%'},
                {title : '昵称',dataIndex :'nickname', elCls: 'center', width:'20%'},
                {title: '头像', dataIndex: 'icon', elCls: 'center', width: '40%', renderer: function (value) {
                    return '<img src="' + value + '" style="width:110px;height:110px" class="addPictureBtn"/>';
                }
                },
                {title : '用户角色',dataIndex :'rid', elCls: 'center', width:'15%', renderer: function (value) {
                    switch (value) {
                        case '2':
                            return '股东';
                        case '3':
                            return '会员';
                        case '4':
                            return '普通用户';
                    }
                }
                },
                {title : '会员订单',dataIndex :'id', elCls: 'center', width:'15%', renderer: function (value) {
                    return '<a href="${basepath}/rest/manage/account/toMyOrder?id=' + value + '">查看</a>';
                }
                }
            ];
    var store = new Store({
                url : '/rest/manage/account/selectSubPage',
                autoLoad:true, //自动加载数据
                params : { //配置初始请求的参数
                    length : '10',
                    pid:postData.id
                },
                pageSize:10,	// 配置分页数目
                root : 'list',
                totalProperty : 'total'
            }),
            grid = new Grid.Grid({
                render:'#grid',
                columns : columns,
                loadMask: true, //加载数据时显示屏蔽层
                store: store,
                plugins : [Grid.Plugins.CheckSelection], // 插件形式引入多选表格
                // 底部工具栏
                bbar:{
                    pagingBar:true
                }
            });
    grid.render();
    //搜索框表单
    var form = new BUI.Form.HForm({
        srcNode: '#searchForm'
    }).render();

    form.on('beforesubmit', function (ev) {
        //序列化成对象
        var obj = form.serializeToObject();
        obj.start = 0; //返回第一页
        store.load(obj);
        return false;
    });
</script>

</@page.pageBase>
